//
//  BaseModel.m
//  GiftThat
//
//  Created by ChuXiang on 16/1/7.
//  Copyright © 2016年 ChuXiang. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel
- (instancetype)initWithDictionary:(NSDictionary *)dictionary
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}

-(id)valueForUndefinedKey:(NSString *)key{
    return nil;
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    if ([key isEqualToString:@"id"]) {
        NSNumber *number = value;
        NSString *str = number.stringValue;
        self.NewId = str;
    }
}

@end
